import React, { Component } from "react";
import Nav from "../../component/nav/Nav";
import { Button, WingBlank } from "antd-mobile";
import { withRouter } from "react-router-dom";

let list = [
    { text: "首页", url: "/menu/homepage" },
    { text: "列表页", url: "/menu/listpage" }
];
class MenuList extends Component {
    state = {};
    goHome = () => {
        this.props.history.push("/menu/homepage");
    };
    render() {
        return (
            <div>
                <div className="nav-barr">
                    <Nav list={list} customEl={<div>自定义插槽组件</div>}>
                        <div>插槽类似vue - slot</div>
                    </Nav>
                </div>
                {this.props.children}
                <WingBlank>
                    <Button onClick={this.goHome}>返回首页</Button>
                </WingBlank>
            </div>
        );
    }
}

export default withRouter(MenuList);
